﻿@model MySqlStudent.UI.Models.Student

@{
    ViewData["Title"] = "学生详情";
    Layout = "~/Views/Shared/_Layout.cshtml";

    var photoPath = "~/img/avatar/noimage.png";
    if (@Model.PhonePath != null)
    {
        photoPath = "~/img/avatar/" + Model.PhonePath;
    }
}

<div class="row justify-content-center m-3">
    <div class="col-sm-6">
        <div class="card">
            <div class="card-header">
                <h1>@Model.Name</h1>
            </div>
            <div class="card-body text-center">
                <img class="card-img-top imageThumnail" src="@photoPath" asp-append-version="true" />
                <h4>名字ID: @Model.Id</h4>
                <h4>邮箱: @Model.Email</h4>
                <h4>主修科目: @Model.Marjor</h4>
                <h4>入学时间: @Model.EnrollmentDate.ToString("yyyy-MM-dd")</h4>
            </div>
            <div class="card-footer text-center">
                <a asp-action="Index" asp-controller="home" class="btn btn-info">
                    返回
                </a>
                <a asp-action="edit" asp-controller="home" asp-route-id="@Model.Id" class="btn btn-primary">编辑</a>
                <a href="#" class="btn btn-danger">删除</a>
            </div>
        </div>
    </div>
</div>

@section Scripts
{
    <script src="~/js/CustomScript.js" asp-append-version="true"></script>
}